package com.ruoyi.web.controller.compensationManagement;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.compensationManagement.domain.CompensationStaffPayrollLog;
import com.ruoyi.compensationManagement.service.ICompensationStaffPayrollLogService;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 工资修改日志Controller
 *
 * @author ruoyi
 * @date 2022-10-12
 */
@RestController
@RequestMapping("/compensationManagement/staffPayrollLog")
public class CompensationStaffPayrollLogController extends BaseController {
    @Autowired
    private ICompensationStaffPayrollLogService compensationStaffPayrollLogService;

    /**
     * 查询工资修改日志列表
     */
    @PreAuthorize("@ss.hasPermi('compensationManagement:staffPayrollLog:list')")
    @GetMapping("/list")
    public TableDataInfo list(CompensationStaffPayrollLog compensationStaffPayrollLog) {
        startPage();
        System.out.println(compensationStaffPayrollLog.toString());
        List<CompensationStaffPayrollLog> list = compensationStaffPayrollLogService.selectCompensationStaffPayrollLogList(compensationStaffPayrollLog);
        for (CompensationStaffPayrollLog staffPayrollLog : list) {
           staffPayrollLog.setLogInfoList(staffPayrollLog.getLogInfo().split("\n"));
        }
        return getDataTable(list);
    }

}
